# Merge in festival variables ---------------------------------------------

el_pilot <- merge(x = el_pilot, y = festival_pilot[, c("tc_id", "n_end_mean")], by = "tc_id")


# Merge in treatment assignment -------------------------------------------

treatment_assignment_pilot <- 
	treatment_assignment_pilot %>% 
	mutate(
		IPV = as.numeric(grepl(pattern = "IPV",x = treatment,ignore.case = TRUE)),
		abortion = as.numeric(grepl(pattern = "abortion",x = treatment,ignore.case = TRUE)),
		absenteeism = as.numeric(grepl(pattern = "absenteeism",x = treatment,ignore.case = TRUE)),
		placebo = as.numeric(grepl(pattern = "control",x = treatment,ignore.case = TRUE))
	)

el_pilot <- merge(
	x = el_pilot,
	y = treatment_assignment_pilot,
	by = "tc_id")



